package com.example.demo.study.designmode.creational.abstractFactory;

import com.example.demo.study.designmode.creational.abstractFactory.define.EarPhone;
import com.example.demo.study.designmode.creational.abstractFactory.define.Phone;
import com.example.demo.study.designmode.creational.abstractFactory.define.TechFactory;
import com.example.demo.study.designmode.creational.abstractFactory.use.AppleFactory;
import com.example.demo.study.designmode.creational.abstractFactory.use.XiaoMiFactory;

public class Main {
    public static void main(String[] args) {
        TechFactory t1 = new AppleFactory();
        Phone phone = t1.getPhone();
        phone.play();
        EarPhone earPhone = t1.getEarPhone();
        earPhone.listen();

        TechFactory t2 = new XiaoMiFactory();
        Phone phone2 = t2.getPhone();
        phone2.play();
        EarPhone earPhone2 = t2.getEarPhone();
        earPhone2.listen();
    }
}
